﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Universe.WCF.Behaviors;

namespace Universe.TrafficProfiler
{
    public class ProcessListModel
    {
        public List<ProcessInfo> Processes = new List<ProcessInfo>();

        public class ProcessInfo
        {
            public bool Selected { get; set; }
            public int Id { get; set; }
            public string FullPath { get; set; }
            public TrafficStatistic OnServer { get; set; }
            public TrafficStatistic OnClient { get; set; }

            public ProcessInfo()
            {
            }

            public ProcessInfo(int id, string path)
            {
                Id = id;
                FullPath = path;
            }

            public long ServerRequests
            {
                get { return OnServer.Total.Requests; }
            }

            public long ClientRequests
            {
                get { return OnClient.Total.Requests; }
            }

            public string File
            {
                get { return System.IO.Path.GetFileName(FullPath); }
            }

            public string Path
            {
                get { return System.IO.Path.GetDirectoryName(FullPath); }
            }
        }
    }
}
